Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Enhance the notification message #414

Merged
merged 9 commits into from
Apr 23, 2022
Merged

Enhance the notification message #414

merged 9 commits into from
Apr 23, 2022

Conversation

noahingh
Copy link
Member

@noahingh noahingh commented Apr 17, 2022

Description

When an event includes only a deployment, it isn't easy to get the status, description, and log_url of deployment status. To resolve this, we should add deployment_status as an event type and build a detailed notification message with a deployment status.

image

Schema

The schema contains two changes: 1) By adding deployment_status as an event type, a notification can include status and description of deployment when fired. 2) Denormalize repo_id in DeploymentStatus to retrieve repository information.

@noahingh noahingh added component: server This issue or pull request is related to the feature of the server-side schema-migration This pull request has a schema-migration enhancement New feature or request labels Apr 17, 2022
@noahingh noahingh linked an issue Apr 17, 2022 that may be closed by this pull request
@noahingh noahingh force-pushed the enhance-notification branch from b07a106 to 122d281 Compare April 18, 2022 13:19
@noahingh noahingh force-pushed the enhance-notification branch from 122d281 to 54e3a27 Compare April 23, 2022 11:06
@noahingh noahingh force-pushed the enhance-notification branch from 54e3a27 to b926519 Compare April 23, 2022 11:07
@noahingh noahingh force-pushed the enhance-notification branch from 703c817 to 61b1763 Compare April 23, 2022 11:20
Comment on lines +259 to +275
func (i *DeploymentInteractor) CreateDeploymentStatus(ctx context.Context, ds *ent.DeploymentStatus) (*ent.DeploymentStatus, error) {
ds, err := i.store.CreateEntDeploymentStatus(ctx, ds)
if err != nil {
return nil, err
}

if _, err := i.store.CreateEvent(ctx, &ent.Event{
Kind: event.KindDeploymentStatus,
Type: event.TypeCreated,
DeploymentStatusID: ds.ID,
}); err != nil {
i.log.Error("Failed to dispatch the event.", zap.Error(err))
}

return ds, nil
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add CreateDeploymentStatus method and create a event internally.

@noahingh noahingh marked this pull request as ready for review April 23, 2022 11:35
@noahingh noahingh added this to the v0.7 milestone Apr 23, 2022
@noahingh noahingh merged commit be0132d into main Apr 23, 2022
@noahingh noahingh deleted the enhance-notification branch April 23, 2022 11:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: server This issue or pull request is related to the feature of the server-side enhancement New feature or request schema-migration This pull request has a schema-migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display the detail of the status such asmessage, and log_url
1 participant